package day8;

import java.util.ArrayList;
import java.util.Scanner;

import org.junit.Test;

public class Demo2 {
	@Test
	public void test1() {
		Scanner scanner = new Scanner(System.in);
		ArrayList<Student> list = new ArrayList<Student>();
		System.out.println("请输入有几个人：");
		int count = scanner.nextInt();
		for (int i = 0; i < count ; i++) {			
			Student student = new Student();
			System.out.println("请输入id");
			student.setId(scanner.nextInt());
			System.out.println("请输入温度");
			student.setWenDu(scanner.nextInt());
			list.add(student);
		}		
		for (Student student : list) {
			int id = 1;
			if (student.getId() == id) {
				System.out.println("id为" + id + "的学生温度为："+student.getWenDu());
			}
		}
	}
	
	@Test
	public void test2() {
		Scanner scanner = new Scanner(System.in);
		ArrayList<Student> list = new ArrayList<Student>();
		System.out.println("请输入有几个人：");
		int count = scanner.nextInt();
		
		
	}
}
